﻿package baseEngine.basic
{
    import __AS3__.vec.*;
    import baseEngine.core.*;

    public class Layer3DSort extends Object
    {
        public var list:Vector.<Mesh3D>;
        public var isActive:Boolean;
        public var layerId:int;

        public function Layer3DSort(param1:int)
        {
            this.list = new Vector.<Mesh3D>;
            this.layerId = param1;
            var _loc_2:* = "layer:" + param1;
            return;
        }// end function

        public function sort() : void
        {
            this.list.sort(this.sortFun);
            this.isActive = false;
            return;
        }// end function

        private function sortFun(param1:Mesh3D, param2:Mesh3D) : int
        {
            if (param1.priority == param2.priority)
            {
                return 0;
            }
            if (param1.priority < param2.priority)
            {
                return -1;
            }
            return 1;
        }// end function

    }
}
